Imports System.Data
Partial Class Admin_EditPurchaseCart
    Inherits System.Web.UI.Page
    Dim _EmployeeId As String
    Dim _ProductId As String
    Dim _bo As New Bo
    Dim dt As New DataTable
    Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
        _bo.UpdateQuantityInPurchaseCart(lblPurchaseId.Text, lblProductId.Text, txtQty.Text)
        Response.Redirect("frmPurchaseCart.aspx")
    End Sub
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        _EmployeeId = Session("EmpId")
        If _EmployeeId = "" Then
            Response.Redirect("../Client/frmLogin.aspx")
        End If
        _ProductId = Request.QueryString("ProductId")
        If _ProductId = "" Then
            Response.Redirect("frmPurchaseCart.aspx")
        End If
        If Page.IsPostBack = False Then
            dt = _bo.getPurchaseCartDetails(_ProductId)
            lblPrice.Text = dt.Rows(0).Item(2).ToString
            lblProductId.Text = _ProductId
            lblPurchaseId.Text = dt.Rows(0).Item(0).ToString
            txtQty.Text = dt.Rows(0).Item(1).ToString
        End If
    End Sub

    Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Response.Redirect("frmPurchaseCart.aspx")
    End Sub
End Class
